package mn.idax.exchange.otc.domain;

import lombok.*;
import mn.idax.exchange.common.UTCTimeUtil;
import mn.idax.exchange.common.bean.IdaxBase;
import mn.idax.exchange.otc.enums.LogTypeEnum;
import mn.idax.exchange.otc.enums.MessageTypeEnum;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.UUID;

/**
 * Create by jack_huang on 2018/8/14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(collection = "otc_chat_log")
public class OrderChat extends IdaxBase{
    private static final long serialVersionUID = 6037566608067001433L;

    private String orderNum;//订单号
    private Integer orderState;
    //    private String message;
//    private Integer senderId;// senderId=0
    private String messageId;

    //消息唯一标识
    @Field
    private String uuid = UUID.randomUUID().toString();
    //发送时间
    @Field
    private Long sendTime = UTCTimeUtil.getUTCTimeLong();
    //发送内容
    @Field
    private String message;
    //资源地址
    @Field
    private String source;
//    原文件名
//    @Field
//    private String name;
    //消息内容类型
    @Field
    private MessageTypeEnum msgType;
    //消息发送类型
    @Field
    private LogTypeEnum logType;
    //已读标识
//    @Field
//    private Integer readFlag;
    //订单唯一标识
    @Field
    private String orderId;
    //发送人
    @Field
    private Integer senderId;
    //更新时间
//    @Field
//    private Long updateTime;

    private boolean saved = true;

    private Object[] dynamicParam;

    private Integer buyerReadFlag;
    private Integer sellerReadFlag;
    private Integer buyerId;
    private Integer sellerId;
    /**
     * 发送人头像
     */
    @Field
    private String userLogo;

}
